<?php
require_once dirname(__FILE__)."/../../classes/Comments.class.php"; 

//выборка пяти последних комментариев
$res = Comments::get_last_comments();
foreach($res as $value){
    $name_user = $value['name_user'];
    $id_post = $value['id_post']; 
    $message = substr($value['message'], 0, 100 )."...";  
    
    echo <<<LABEL
    <table style = "width: 310px" valign="top">
      <tr>
        <td width = "200px" height = "20px" bgcolor="#F0F8FF" valign="top">
    $name_user: <br />
    <a href="index.php?more=$id_post">$message</a>    <br />
        </td>
      </tr>
    </table>
LABEL;
    
}  
?>
